package com.ts.admin.modules.content;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ts.common.core.utils.Result;
import com.ts.feign.api.DiscussService;
import com.ts.feign.dto.DiscussDTO;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 话题
 *
 * @author admin admin@qq.com
 * @since 1.0.0 2023-02-22
 */
@RestController
@RequestMapping("/discuss")
@Api(tags="话题")
public class DiscussController {
    @Autowired
    private DiscussService discussService;

    //查询话题的分页信息
    @PostMapping("/list")
    public Result<DiscussDTO> page(Page<DiscussDTO> page){
        Page<DiscussDTO> page1 = discussService.list(page);
        return new Result().ok(page1);
    }

    @PostMapping("/save")
    public Result save(@RequestBody DiscussDTO discussDTO){
        discussService.save(discussDTO);
        return new Result();
    }


}